<?php
include "includes/db.php";
$mysqli = new MossCMS();

if ($_SESSION[$prefix.'_username'] == ""){  header("Location: login.php"); exit;}

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Moss, Inc - Portal</title>
<link href="includes/sw_orig.css" rel="stylesheet" type="text/css" media="screen" />
<link href="includes/local.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="container">
  <div id="header">
  <?php include "includes/header.php"; ?>
	</div>


<div id="mainContent" class="frontpage">
<h1>News</h1>
<br>
<table width="600"> 
	  <thead> 
	  <tr> 
		<th>Date</th> 
		<th>Title</th> 
	  </tr> 
	  </thead> 
	  <tbody> 
	  <?php
	  $results = $mysqli->news_list_frontend($_SESSION[$prefix.'_groups']);
		for($x=0; $x < sizeof($results); $x++) {
			$date = date('m/d/Y',(strtotime($results[$x]['content_date'])));
		?>
	  <tr align='left'>
	  	<td><a href='article.php?id=<?php echo $results[$x]['content_id'];?>'><?php echo $date;?></a></td>
	  	<td><a href='article.php?id=<?php echo $results[$x]['content_id'];?>'><?php echo $results[$x]['content_title'];?></a></td>
	  </tr>
	<?php } ?>  
</tbody>
</table>	  
	  
	  
            
		<div class="clear"></div>	

 
<div id="footer">
	<?php include "includes/footer.php"; ?>
</div>
<!-- end #container --></div>

<br />
</body>
</html>
